/**
 * Contains {@link SwitchRecord}
 */
package logic.pathelements;

import logic.connectors.Connector;

/**
 * Switch connector to other active path element macAddress correspondence
 * @author Alexey Akimov <frinatella@gmail.com>
 */
 public class SwitchRecord extends Record {

    /**
     * active path MAC can be reach from this switch connector
     */
    private long macAddress;
    
    /**
     * sets switch connector to other active path element MAC correspondence
     * @param connector switch connector
     * @param macAddress active path element MAC can be reach from this switch connector
     */
    public SwitchRecord(Connector connector, long macAddress) {
        super(connector);
        this.macAddress = macAddress;
    }

    /**
     * Gettter
     * @return path element MAC can be reach from this switch connector
     */
    public long getmacAddress() {
        return macAddress;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final SwitchRecord other = (SwitchRecord) obj;
        if (this.connector == other.connector && this.macAddress == other.macAddress) {
            return true;
        }
        return false;
    }
    
}
